package com.hdoit.apollo.logical.cargo.dao.impl;

import org.springframework.stereotype.Component;

import com.hdoit.apollo.logical.cargo.dao.IUnitDao;
import com.hdoit.apollo.logical.cargo.model.Unit;
import com.tennetcn.data.dao.base.ISqlExpression;
import com.tennetcn.data.dao.base.impl.SuperDao;
import com.tennetcn.data.utils.SqlExpressionFactory;
/**
 * @author      humaoshu
 * @email       
 * @createtime  2018年06月07日 10:18:06
 * @comment
 */
@Component
public class UnitDaoImpl extends SuperDao<Unit> implements IUnitDao{

	@Override
	public boolean deleteUnit(String unitId) {
		ISqlExpression sqlExpression = SqlExpressionFactory.createExpression();
		sqlExpression.addBody("delete from",Unit.class)
					.andWhere("unitId=#{unitId}")
					.setParam("unitId", unitId);
		return delete(sqlExpression)>=0;
	}

}